---
title: "Setting Up and Deploying | Mastra Cloud"
description: Configuration steps for Mastra Cloud projects
---

import { MastraCloudCallout } from "@site/src/components/MastraCloudCallout";
import Steps from "@site/src/components/Steps";
import StepItem from "@site/src/components/StepItem";

# Setting Up and Deploying

This page explains how to set up a project on [Mastra Cloud](https://mastra.ai/cloud) with automatic deployments using our GitHub integration.

<MastraCloudCallout />

## Prerequisites

- A [Mastra Cloud](https://mastra.ai/cloud) account
- A GitHub account / repository containing a Mastra application

> See our [Getting started](/guides/v1/getting-started/quickstart) guide to scaffold out a new Mastra project with sensible defaults.

## Setup and Deploy process

<Steps>

<StepItem>

Head over to [https://cloud.mastra.ai/](https://cloud.mastra.ai) and sign in with either:

- **GitHub**
- **Google**

</StepItem>

<StepItem>

When prompted, install the Mastra GitHub app.

![Install GitHub](/img/mastra-cloud/mastra-cloud-install-github.jpg)

</StepItem>

<StepItem>

Click the **Create new project** button to create a new project.

![Create new project](/img/mastra-cloud/mastra-cloud-create-new-project.jpg)

</StepItem>

<StepItem>

Search for a repository, then click **Import**.

![Import Git repository](/img/mastra-cloud/mastra-cloud-import-git-repository.jpg)

</StepItem>

<StepItem>

Mastra Cloud automatically detects the right build settings, but you can customize them using the options described below.

![Deployment details](/img/mastra-cloud/mastra-cloud-deployment-details.jpg)

- **Importing from GitHub**: The GitHub repository name
- **Project name**: Customize the project name
- **Branch**: The branch to deploy from
- **Project root**: The root directory of your project
- **Mastra directory**: Where Mastra files are located
- **Environment variables**: Add environment variables used by the application
- **Build and Store settings**:
  - **Install command**: Runs pre-build to install project dependencies
  - **Project setup command**: Runs pre-build to prepare any external dependencies
  - **Port**: The network port the server will use
  - **Store settings**: Use Mastra Cloud's built-in [LibSQLStore](/docs/v1/server-db/storage) storage
- **Deploy Project**: Starts the deployment process

</StepItem>

<StepItem>

Click **Deploy Project** to create and deploy your application using the configuration you've set.

</StepItem>

</Steps>

## Successful deployment

After a successful deployment you'll be shown the **Overview** screen where you can view your project's status, domains, latest deployments and connected agents and workflows.

![Successful deployment](/img/mastra-cloud/mastra-cloud-successful-deployment.jpg)

## Continuous integration

Your project is now configured with automatic deployments which occur whenever you push to the configured branch of your GitHub repository.

## Testing your application

After a successful deployment you can test your agents and workflows [Studio](/docs/v1/deployment/mastra-cloud/dashboard#studio) in Mastra Cloud, or interact with them using our [Client SDK](/docs/v1/server-db/mastra-client).

## Next steps

- [Navigating the Dashboard](/docs/v1/deployment/mastra-cloud/dashboard)
